<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
        /* Initialize action controller here */
    }

    public function indexAction()
    {
        // blog
    	$blogM = new Application_Model_BlogMapper();
        $this->view->blogs = $blogM->fetchAll();
//	    $this->view->addScriptPath(APPLICATION_PATH ."/views/helpers/");
//	    Zend_View_Helper_PaginationControl::setDefaultViewPartial('controls.phtml');
//	    $data = range(1,100);
//	    $paginator = Zend_Paginator::factory($this->view->entries);
//	    $paginator->setCurrentPageNumber($this->_getParam('page', 1))
//                  ->setItemCountPerPage(1);
//	    $this->view->paginator = $paginator;

        //info
        $infoM = new Application_Model_InfoMapper();
        $info  = new Application_Model_Info();
        $infoM->selectNewest($info);
        $this->view->infor = $info;
        //keyword
        $keywordM = new Application_Model_KeywordMapper();
        $this->view->keywords = $keywordM->fetchAll();
        //nav
        $modM = new Application_Model_ModuleMapper();
        $this->view->nav = $modM->fetchAll();

        //commit
        $commitM = new Application_Model_CommitMapper();
        $this->view->commit = $commitM->findByBlogId(0);
        $this->view->commitId = 1;
    }
}

